<html>
  <head>
	<title><g:layoutTitle default="${message(code:'app.name')}" /></title>
	<link rel="stylesheet" href="${resource(dir:'css',file:'main.css')}" />
	<link rel="shortcut icon" href="${resource(dir:'images',file:'favicon.ico')}" type="image/x-icon" />
  <g:layoutHead />
  <r:layoutResources/>
  <g:javascript src="application.js" />
</head>

<body>
  <div id="spinner" class="spinner" style="display:none;">
	<img src="${resource(dir:'images',file:'spinner.gif')}" alt="Spinner" />
  </div>

  <div id="layoutHeader" class="layoutHeader">
	<table style="border:0px;height:70px;">
	  <tr>
		<td>
		  <div id="appLogo" class="logo">
			<a href="${message(code:'app.website')}">
			  <img src="${resource(dir:'images',file:'logo.png')}" alt="${message(code:'app.website')}" border="0" />
			</a>
		  </div>
		</td>

		<td>
		  <div id="appTitle">
			<a href="${createLink(uri:'/')}" style="border:1px;">
			  <p><g:message code="app.title"/></p>
			</a>
		  </div>
		</td>
	  </tr>

	</table>

  </div>

  <div class="nav" style="margin-top:0px;">
	
	<g:if test="${!session.userId}">
	  <g:link controller="user" action="login"><g:message code="default.login.label"/></g:link>
	</g:if>
	
	<g:if test="${session.userId || System.getProperty('grails.env') == 'development'}">
	  
	  <!-- Menu Home -->
	  <span class="menuButton">
		<a class="${!params.controller?'selected':'home'}" href="${createLink(uri:'/')}"><g:message code="menu.home"/></a>
	  </span>

	  <!-- Menu User -->
	  <span class="menuButton"><b>|</b>
		<g:link controller="user" action="list" class="${params.controller=='user'?'selected':'user'}"><g:message code="menu.user"/></g:link>
	  </span>
	  
	  <!-- Menu Role -->
	  <g:if test="${grailsApplication.config.modules.menu.role.show}">
		<span class="menuButton"><b>|</b>
		  <g:link controller="role" action="list" class="${params.controller=='role'?'selected':'role'}"><g:message code="menu.role"/></g:link>
		</span>
	  </g:if>
	  
	  <!-- Menu Privilege -->
	  <g:if test="${grailsApplication.config.modules.menu.privilege.show}">
		<span class="menuButton"><b>|</b>
		  <g:link controller="privilege" action="list" class="${params.controller=='privilege'?'selected':'privilege'}"><g:message code="menu.privilege"/></g:link>
		</span>
	  </g:if>
	  
	  <!-- Menu Logout -->
	  <span class="menuButton"><b>|</b><g:link controller="user" action="logout"><g:message code="default.logout.label"/> "${session.userName}"</g:link></span>
	  
	</g:if>
  </div>

  <div style="height:auto;">
	<g:layoutBody />
	<div style="clear: both;display: block"></div>
  </div>

  <div class="nav">
	<p style="margin-left:20px;width:80%"><g:message code="app.copyright"/> </p>
</div>
</body>
</html>